//
//  YKPerformanceListViewController.m
//  YunKang
//
//  Created by leoking870 on 2017/10/2.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKPerformanceListViewController.h"
#import "YKClientListHeaderView.h"
#import "YKPerformanceItem.h"
@interface YKPerformanceListViewController ()

@end

@implementation YKPerformanceListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"业绩明细";
    
    YKClientListHeaderView* listHeaderView = [[YKClientListHeaderView alloc]initWithTitles:@[@"订单单号",@"产品名称",@"采购数量",@"获取积分"] weights:@[@2,@3,@2,@2]];
    listHeaderView.backgroundColor = [UIColor tf_colorWithHexString:@"#1EADFC"];
    listHeaderView.textFont = [UIFont systemFontOfSize:15];
    [self.view addSubview:listHeaderView];
    [listHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.top.trailing.equalTo(self.view);
    }];
    
    [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.leading.bottom.trailing.equalTo(self.view);
        make.top.equalTo(listHeaderView.mas_bottom);
    }];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.tableFooterView = [UIView new];
//#pragma mark - MOCK
//    TFTableViewSection* section = [TFTableViewSection section];
//    section.headerHeight = .1f;
//    section.footerHeight = .1f;
//    //    @weakify(self)
//    for (int i = 0; i < 10; ++i) {
//        YKPerformanceItem* item = [YKPerformanceItem item];
//        [section addItem:item];
//        item.hideSeparator = YES;
//        item.selectionHandler = ^(__kindof TFTableViewItem *item, NSIndexPath *indexPath) {
//        };
//    }
//
//    [self.dataSource.manager addSection:section];
    
    self.dataSource.totalPageKey = @"page.totalpage";
    self.dataSource.currentPageKey = @"curpage";
    [self startLoadData];
}


- (NSDictionary *)pageViewControllerParameters {
    return @{
             kTFPageViewControllerItemClass: [YKPerformanceItem class],
             kTFPageViewControllerModelClass:[YKPerformanceModel class],
             kTFPageViewControllerRequestURL:@"personalCentr/searchAchievementIntegralDetailList.htm",
             kTFPageViewControllerDataKeyPath:@"list"
             };
}
@end
